import { PORT1 } from '@/api/config';
import { MockMethod } from 'vite-plugin-mock';

const accessPage = {
  url: PORT1 + `/log/access/page`,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: {
        total: 15,
        list: [
          {
            id: '1720352707342086146',
            loginName: 'admin',
            ipAddress: '103.208.13.50',
            loginLocation: '北京市 北京市',
            browser: 'Chrome 11',
            os: 'Windows 10',
            status: '0',
            msg: '登录成功',
            loginTime: '2023-11-03T16:10:22',
          },
          {
            id: '1720343617740058625',
            loginName: 'admin',
            ipAddress: '103.208.13.50',
            loginLocation: '北京市 北京市',
            browser: 'Chrome 11',
            os: 'Windows 10',
            status: '0',
            msg: '登录成功',
            loginTime: '2023-11-03T15:34:15',
          },
          {
            id: '1720332904879468545',
            loginName: 'admin',
            ipAddress: '103.208.13.50',
            loginLocation: '北京市 北京市',
            browser: 'Chrome 11',
            os: 'Windows 10',
            status: '0',
            msg: '登录成功',
            loginTime: '2023-11-03T14:51:41',
          },
          {
            id: '1705855726557138946',
            loginName: 'admin',
            ipAddress: '113.128.80.48',
            loginLocation: '山东省 济南市',
            browser: 'Chrome 9',
            os: 'Windows 10',
            status: '0',
            msg: '登录成功',
            loginTime: '2023-09-24T16:04:33',
          },
          {
            id: '1705134896642592769',
            loginName: 'admin',
            ipAddress: '113.128.80.48',
            loginLocation: '山东省 济南市',
            browser: 'Chrome 9',
            os: 'Windows 10',
            status: '0',
            msg: '登录成功',
            loginTime: '2023-09-22T16:20:13',
          },
          {
            id: '1705114855704432641',
            loginName: 'admin',
            ipAddress: '113.128.80.48',
            loginLocation: '山东省 济南市',
            browser: 'Chrome 9',
            os: 'Windows 10',
            status: '0',
            msg: '登录成功',
            loginTime: '2023-09-22T15:00:35',
          },
          {
            id: '1705026878957490177',
            loginName: 'admin',
            ipAddress: '113.128.80.48',
            loginLocation: '山东省 济南市',
            browser: 'Chrome 9',
            os: 'Windows 10',
            status: '0',
            msg: '登录成功',
            loginTime: '2023-09-22T09:11:00',
          },
          {
            id: '1704801260705746945',
            loginName: 'admin',
            ipAddress: '113.128.80.48',
            loginLocation: '山东省 济南市',
            browser: 'Chrome 9',
            os: 'Windows 10',
            status: '0',
            msg: '登录成功',
            loginTime: '2023-09-21T18:14:28',
          },
          {
            id: '1704801071580385281',
            loginName: 'test',
            ipAddress: '113.128.80.48',
            loginLocation: '山东省 济南市',
            browser: 'Chrome 9',
            os: 'Windows 10',
            status: '1',
            msg: '用户不存在',
            loginTime: '2023-09-21T18:13:43',
          },
          {
            id: '1704756579443740674',
            loginName: 'admin',
            ipAddress: '113.128.80.48',
            loginLocation: '山东省 济南市',
            browser: 'Chrome 9',
            os: 'Windows 10',
            status: '0',
            msg: '登录成功',
            loginTime: '2023-09-21T15:16:56',
          },
        ],
      },
      message: 'success',
    };
  },
};

const operationPage = {
  url: PORT1 + `/log/operation/page`,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: {
        total: 15,
        list: [
          {
            id: '1644545726874718210',
            title: '系统配置',
            businessType: '8',
            method: 'top.plgxs.admin.controller.sys.SysConfigController.switchStatus()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin ',
            operUrl: '/sysConfig/switchStatus',
            operIp: '60.25.153.169',
            operLocation: '',
            operParam: '{"id":["1409078174394880002"],"status":["0"]}',
            jsonResult: '{"msg":"切换成功","code":200,"success":true,"timestamp":1680925230125}',
            status: '0',
            errorMsg: '',
            operTime: '2023-04-08T11:40:30',
          },
          {
            id: '1644545724211335169',
            title: '系统配置',
            businessType: '8',
            method: 'top.plgxs.admin.controller.sys.SysConfigController.switchStatus()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin ',
            operUrl: '/sysConfig/switchStatus',
            operIp: '60.25.153.169',
            operLocation: '',
            operParam: '{"id":["1409078174394880002"],"status":["1"]}',
            jsonResult: '{"msg":"切换成功","code":200,"success":true,"timestamp":1680925229170}',
            status: '0',
            errorMsg: '',
            operTime: '2023-04-08T11:40:29',
          },
          {
            id: '1572034788750061569',
            title: '通知公告',
            businessType: '1',
            method: 'top.plgxs.admin.controller.sys.SysNoticeController.insert()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin',
            operUrl: '/sysNotice/insert',
            operIp: '61.133.195.142',
            operLocation: '',
            operParam: '',
            jsonResult: '{"msg":"操作成功","code":200,"success":true,"timestamp":1663637275288}',
            status: '0',
            errorMsg: '',
            operTime: '2022-09-20T09:27:55',
          },
          {
            id: '1561338193268240386',
            title: '系统配置',
            businessType: '2',
            method: 'top.plgxs.admin.controller.sys.SysConfigController.switchTheme()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin',
            operUrl: '/sysConfig/switchTheme/0',
            operIp: '222.90.159.82',
            operLocation: '',
            operParam: '',
            jsonResult: '{"msg":"切换主题","code":200,"success":true,"timestamp":1661087008192}',
            status: '0',
            errorMsg: '',
            operTime: '2022-08-21T21:03:28',
          },
          {
            id: '1523283821166915586',
            title: '系统配置',
            businessType: '2',
            method: 'top.plgxs.admin.controller.sys.SysConfigController.switchTheme()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin',
            operUrl: '/sysConfig/switchTheme/2',
            operIp: '1.203.67.230',
            operLocation: '',
            operParam: '',
            jsonResult: '{"msg":"切换主题","code":200,"success":true,"timestamp":1652014138867}',
            status: '0',
            errorMsg: '',
            operTime: '2022-05-08T20:48:58',
          },
          {
            id: '1512342876992892929',
            title: '系统配置',
            businessType: '2',
            method: 'top.plgxs.admin.controller.sys.SysConfigController.switchTheme()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin',
            operUrl: '/sysConfig/switchTheme/1',
            operIp: '60.21.100.32',
            operLocation: '',
            operParam: '',
            jsonResult: '{"msg":"切换主题","code":200,"success":true,"timestamp":1649405614504}',
            status: '0',
            errorMsg: '',
            operTime: '2022-04-08T16:13:34',
          },
          {
            id: '1512342878699974658',
            title: '系统配置',
            businessType: '2',
            method: 'top.plgxs.admin.controller.sys.SysConfigController.switchTheme()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin',
            operUrl: '/sysConfig/switchTheme/0',
            operIp: '60.21.100.32',
            operLocation: '',
            operParam: '',
            jsonResult: '{"msg":"切换主题","code":200,"success":true,"timestamp":1649405614910}',
            status: '0',
            errorMsg: '',
            operTime: '2022-04-08T16:13:34',
          },
          {
            id: '1512342870873403394',
            title: '系统配置',
            businessType: '2',
            method: 'top.plgxs.admin.controller.sys.SysConfigController.switchTheme()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin',
            operUrl: '/sysConfig/switchTheme/8',
            operIp: '60.21.100.32',
            operLocation: '',
            operParam: '',
            jsonResult: '{"msg":"切换主题","code":200,"success":true,"timestamp":1649405613045}',
            status: '0',
            errorMsg: '',
            operTime: '2022-04-08T16:13:33',
          },
          {
            id: '1512342874090434561',
            title: '系统配置',
            businessType: '2',
            method: 'top.plgxs.admin.controller.sys.SysConfigController.switchTheme()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin',
            operUrl: '/sysConfig/switchTheme/4',
            operIp: '60.21.100.32',
            operLocation: '',
            operParam: '',
            jsonResult: '{"msg":"切换主题","code":200,"success":true,"timestamp":1649405613811}',
            status: '0',
            errorMsg: '',
            operTime: '2022-04-08T16:13:33',
          },
          {
            id: '1498547193403994113',
            title: '用户管理',
            businessType: '4',
            method: 'top.plgxs.admin.controller.sys.SysUserController.saveUserRole()',
            requestMethod: 'POST',
            operatorType: '1',
            operName: 'admin',
            operUrl: '/sysUser/saveUserRole',
            operIp: '183.242.44.3',
            operLocation: '',
            operParam: '',
            jsonResult: '{"msg":"操作成功","code":200,"success":true,"timestamp":1646116467226}',
            status: '0',
            errorMsg: '',
            operTime: '2022-03-01T14:34:27',
          },
        ],
      },
      message: 'success',
    };
  },
};

const operationDetail = {
  url: PORT1 + `/log/operation/detail/1644545726874718210`,
  method: 'get',
  response: () => {
    return {
      code: 200,
      data: {
        id: '1644545726874718210',
        title: '系统配置',
        businessType: '8',
        method: 'top.plgxs.admin.controller.sys.SysConfigController.switchStatus()',
        requestMethod: 'POST',
        operatorType: '1',
        operName: 'admin ',
        operUrl: '/sysConfig/switchStatus',
        operIp: '60.25.153.169',
        operLocation: '',
        operParam: '{"id":["1409078174394880002"],"status":["0"]}',
        jsonResult: '{"msg":"切换成功","code":200,"success":true,"timestamp":1680925230125}',
        status: '0',
        errorMsg: '',
        operTime: '2023-04-08T11:40:30',
      },
      message: 'success',
    };
  },
};
export default [accessPage, operationPage, operationDetail] as MockMethod[];
